<?php

include '../DB/dbConnection.php';

$result=array();

if ($_POST){
	
	$sql = "INSERT INTO subject(name, test_max, main_max, standard_id, division_id, school_id) VALUES ('".$_POST['name']."', '".$_POST['test_max']."', '".$_POST['main_max']."', '".$_POST['standard_id']."', '".$_POST['division_id']."', '".$_POST['school_id']."')";
	$res = mysqli_query($conn, $sql);

	if($res)
		$result['error']=false;
	else
		$result['error']=true;
}
else
{
	$result['error']=true;
}

$conn->close();	

echo json_encode($result);
?> 
